package com.ultra.view;

import java.util.ArrayList;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.ListView;

import com.ultra.R;
import com.ultra.adapter.MenuAdapter;
import com.ultra.model.SysModule;
import com.ultra.ui.UI;
import com.ultra.util.ImgUtil;

public class MenuView{
	private View menuView;
	public MenuView(Context context,SlidingViewGroup svg) {
		menuView = LayoutInflater.from(context).inflate(R.layout.view_menu, null);
		menuView.findViewById(R.id.menu_head_bg).setBackgroundDrawable(ImgUtil.getImgDrawable(ImgUtil.BG,UI.BACKGROUND.MENU_HEAD_BG));
		((ImageView)menuView.findViewById(R.id.menu_head_title)).setImageDrawable(ImgUtil.getImgDrawable(ImgUtil.WA,UI.WORDART.MENU_HEAD_TITLE));
	
		ArrayList<SysModule> sysModuleList = new ArrayList<SysModule>();
		String[] names = { "代维工单", "基站巡检","线路巡检","抽查巡检","隐患上报","资源检索", "系统公告", "系统设置"};
		String[] imgs = { "icon_gd.png", "icon_gd.png","icon_gd.png","icon_gd.png","icon_gd.png","icon_gd.png","icon_gd.png","icon_gd.png"};
		for(int i=0;i<names.length;i++){
			SysModule sysModule = new SysModule();
			sysModule.setModuleNameCn(names[i]);
			sysModule.setImageUrl(imgs[i]);
			sysModuleList.add(sysModule);
		}
		
		
		ListView menuList = (ListView) menuView.findViewById(R.id.menu_list);
		MenuAdapter adapter = new MenuAdapter(context,sysModuleList);
		menuList.setAdapter(adapter);
	
	}
	public View getMenuView() {
		return menuView;
	}
}